Technote 1020Color Cursing: Problems to look for with Colorrevised by Michael Marinkovich, February 1996 revised by Timothy Carroll, December 1997 Apple Developer Technical Support |
CONTENTS |
The creation and use of color cursors is discussed in the chapter on cursor utilities in Inside Macintosh: Imaging with QuickDraw. If you're building an application that uses color cursors, you may encounter some quirks present in Color QuickDraw. This Technote provides solutions to a few common problems. |
SetCCursor
changing the GDevice
, and SetCCursor
moving memory
were added in December, 1997.
Using Color CursorsTo avoid system errors or crashes while using a color cursor, incorporate the following information in your application development.
Setting Bounds for your CursorIf your cursor is, for example, 15 pixels tall and 9 pixels wide, you might be tempted to use these values for the bounds.bottom and bounds.right, respectively, in your cursor's pixel map. Don't. When the cursor's image needs to be expanded (that is, when you specify a two bit-per-pixel cursor and the mouse pointer is on an eight-bit screen) theSetCCursor trap rounds the
width of the pixel map in such a way that you'll get only the space required
for a 15 by 8 pixel map allocated for the expanded cursor data. When the
cursor's image is expanded into this too-small expanded cursor data handle as a
15 by 9 pixel map, something in your heap will get munched.
To avoid this problem, always specify the
Inopportune Purging of a `
If you load a color cursor's color table from a ' |